Telegram Group & Telegram Channel
Списковые включения

На основе итерируемых объектов можно удобно и без циклов строить списки в одну строчку — такой синтаксис называется списковыми включениями.

Сейчас подробнее разберем именно списки, но по такому же принципу можно создавать и словари.

В квадратных скобках вы пишите самую обычную конструкцию цикла for, но само выражение ставите перед ключевым словом for. Также можно добавлять условия в конце записи.

Как правило, списковые включения работают заметно быстрее, чем циклы. Однако, злоупотреблять этим не рекомендуется, так как это зачастую снижает читаемость кода.

#списки #словари



tg-me.com/python_academy/391
Create:
Last Update:

Списковые включения

На основе итерируемых объектов можно удобно и без циклов строить списки в одну строчку — такой синтаксис называется списковыми включениями.

Сейчас подробнее разберем именно списки, но по такому же принципу можно создавать и словари.

В квадратных скобках вы пишите самую обычную конструкцию цикла for, но само выражение ставите перед ключевым словом for. Также можно добавлять условия в конце записи.

Как правило, списковые включения работают заметно быстрее, чем циклы. Однако, злоупотреблять этим не рекомендуется, так как это зачастую снижает читаемость кода.

#списки #словари

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/391

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

Telegram hopes to raise $1bn with a convertible bond private placement

The super secure UAE-based Telegram messenger service, developed by Russian-born software icon Pavel Durov, is looking to raise $1bn through a bond placement to a limited number of investors from Russia, Europe, Asia and the Middle East, the Kommersant daily reported citing unnamed sources on February 18, 2021.The issue reportedly comprises exchange bonds that could be converted into equity in the messaging service that is currently 100% owned by Durov and his brother Nikolai.Kommersant reports that the price of the conversion would be at a 10% discount to a potential IPO should it happen within five years.The minimum bond placement is said to be set at $50mn, but could be lowered to $10mn. Five-year bonds could carry an annual coupon of 7-8%.

Python Academy from tr


Telegram Python Academy
FROM USA